package com.lbn.jfqsc.app.account.collection;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.jcodecraeer.xrecyclerview.XRecyclerView;
import com.lbn.baseframe.base.BaseActivity;
import com.lbn.baseframe.base.BaseRecyclerAdapter;
import com.lbn.baseframe.ui.NAppbar;
import com.lbn.jfqsc.R;
import com.lbn.jfqsc.app.account.collection.adapter.CollectionAdapter;

import butterknife.BindView;
import butterknife.ButterKnife;

public class CollectionActivity extends BaseActivity<CollectionPresenter> implements ICollectionView,
        XRecyclerView.LoadingListener,BaseRecyclerAdapter.OnItemClickListener {

    @BindView(R.id.recycler_view)
    XRecyclerView recyclerView;

    private CollectionAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_collection);
        ButterKnife.bind(this);
        setAppbar(new NAppbar(this));
        appbar.openBack();
        appbar.setTitle("我的收藏");
    }


    @Override
    public void onPresenterCreated() {
        super.onPresenterCreated();
        adapter = new CollectionAdapter(this,null);
        adapter.setOnItemClickListener(this);
        recyclerView.setLoadingListener(this);
        recyclerView.setAdapter(adapter);
//        recyclerView.setRefreshing(true);
    }

    public static void startActivity(Context context) {
        context.startActivity(new Intent(context, CollectionActivity.class));
    }


    @Override
    public CollectionPresenter createPresenter() {
        return new CollectionPresenter();
    }

    @Override
    public void onRefresh() {

    }

    @Override
    public void onLoadMore() {

    }

    @Override
    public void onItemClick(View itemView, int pos) {

    }
}
